package com.dixiang.framework;

import com.dixiang.framework.config.SystemConstants;
import com.dixiang.framework.utils.Utils;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;

public abstract class BaseActivity extends Activity{
	public Activity activity;
	public Handler handler = new Handler();
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		activity = this;
		Utils.initExcption(this);
		SystemConstants.putHandler(this.getClass().getSimpleName(), handler);
	}
	
	@Override
	protected void onResume() {
		super.onResume();
	}
	
	@Override
	protected void onPause() {
		super.onPause();
	}
	
	@Override
	protected void onStop() {
		super.onStop();
		SystemConstants.refreshHandler(this.getClass().getSimpleName());
	}
	
	@Override
	protected void onRestart() {
		super.onRestart();
		SystemConstants.refreshHandler(this.getClass().getSimpleName());
	}
	
	@Override
	protected void onDestroy() {
		super.onDestroy();
		SystemConstants.removeHandler(this.getClass().getSimpleName());
		//handler = null;
	}
	
}
